import {
	getUserInfo
} from '@/api/user.js'

export default {
	namespaced: true,
	state: {
		userToken: uni.getStorageSync('userToken'),
		userInfo: {}
	},
	mutations: {
		setuserToken(state, value) {
			state.userToken = value
		},
		setUserInfo(state, value) {
			state.userInfo = value
		}
	},
	actions: {
		async loadUserInfo(store) {
			const res = await getUserInfo()
			// console.log(res)
			store.commit('setUserInfo', res.data)
		}
	},
	getters: {},
	modules: {}

}
